home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 5
/
Skunkware 5.iso
/
src
/
X11
/
xconq
/
dir.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-09
|
1KB
|
43 lines
/* Copyright (c) 1987, 1988 Stanley T. Shebs, University of Utah. */
/* This program may be used, copied, modified, and redistributed freely */
/* for noncommercial purposes, so long as this notice remains intact. */
#pragma comment(exestr, "@(#) dir.h 12.1 95/05/09 ")
/* RCS $Header: dir.h,v 1.1 88/06/21 12:29:39 shebs Exp $ */
/* Definitions for directions of the compass. */
/* The terrain model is based on hexes arranged in horizontal rows. This */
/* means that although east and west remain intact, the concepts of north */
/* and south have basically vanished. */
/* Unfortunately, not all hex-dependent definitions are here. Pathfinding */
/* code has some knowledge of hexes also, as does map generation. */
#define NUMDIRS 6
#define NE 0
#define EAST 1
#define SE 2
#define SW 3
#define WEST 4
#define NW 5
#define DIRNAMES { "NE", "E", "SE", "SW", "W", "NW" }
#define DIRX { 0, 1, 1, 0, -1, -1 }
#define DIRY { 1, 0, -1, -1, 0, 1 }
#define DIRCHARS "ulnbhy"
#define random_dir() (random(6))
#define for_all_directions(dir) for (dir = 0; dir < 6; ++dir)
#define opposite_dir(d) (((d) + 3) % 6)
extern char *dirnames[];
extern int dirx[], diry[];